{% extends '__base.tpl' %}

{% block head %}
{{super()}}
<!-- build:css -->
    <link rel="stylesheet" type="text/css" href="../../../public/css/page/userAddress.css" />
<!-- endbuild -->
{% endblock %}

{% block body %}
<div class="user-bg">
    <div id="box">
        <div class="address-box">
            <div class="address-title">
                <span class="font24">收货地址管理</span>
                <a class="blue font12 ml10" href="javascript:history.back()">返回</a>
            </div>
            <div class="all-address">
                <!--地址列表start-->
                <table class="table">
                    <tbody id="addressList"></tbody>
                    <script id="addressList_tpl" type="text/html">
                        <% each data as arr i %>
                        <tr>
                            <td width="30" align="center"><%arr.name%></td>
                            <td width="80" align="center"><%arr.tel%></td>
                            <td width="180" align="left"><%arr.provinceName%><%arr.cityName%><%arr.areaName%><%arr.address%></td>
                            <td width="100" align="center">
                                <input class="radio" type="radio" name="default-address"
                                       onclick="BASE.USER_ADDERSS.setDefautlAddress('<%arr.id%>')"
                                <%if arr.defaultIs%> checked <%/if%> />
                                设置为默认地址
                            </td>
                            <td width="25" align="center">
                                <a class="clo3" href="javascript:;" data-id="<%arr.id%>"  data-name="<%arr.name%>"  data-tel="<%arr.tel%>"
                                   data-provinceid="<%arr.provinceId%>"  data-cityid="<%arr.cityId%>"  data-areaid="<%arr.areaId%>"
                                   data-address="<%arr.address%>" data-defaultis="<%arr.defaultIs.toString()%>" data-postcode="<%arr.postCode%>"
                                   onclick="BASE.USER_ADDERSS.modifyAddressPrev(this)">修改</a>
                            </td>
                            <td width="25" align="center">
                                <a  class="clo3" href="javascript:;"
                                    onclick="BASE.USER_ADDERSS.deleteAdderss.call(this,'<%arr.id%>');">删除</a>
                            </td>
                        </tr>
                        <%/each%>
                    </script>
                </table>
                <!--地址列表end-->
            </div>
            <div class="add-address-box ">
                <dl>
                    <dd class="require">地址信息：</dd>
                    <dt>
                        {% include '__address_area_select.html' %}
                        {% include '__address_area_script.html' %}
                    </dt>
                </dl>
                {% include '__address_add.html' %}
                <div class="address-bottom center mt20">
                    <button class="common-btn" id="saveBtn" onclick="BASE.USER_ADDERSS.addAddress(this)">保存</button>
                    <button class="common-btn" style="display: none" id="modifyBtn" onclick="BASE.USER_ADDERSS.modifyAddress(this)">确认修改</button>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block script %}
    {{ super() }}
<!-- build:js -->
    <script src="../../../public/js/page/user/user_userAddress.js"></script>
<!-- endbuild -->
{% endblock %}